﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CommerceOne.Domains.SqlRepositories;
using CommerceOne.Models.Entities;

namespace CommerceOne.Domains.Services
{
    public class AuthenticationService
    {
        public Boolean ValidateContact(String email, string password)
        {
            var contact = SqlContactRepository.Instance.GetByEmail(email, true);
            if (contact == null) return false;
            return contact.PasswordHash.Equals(password);
        }

        private static AuthenticationService _instance;
        public static AuthenticationService Instance
        {
            get { return _instance ?? (_instance = new AuthenticationService()); }
        }
    }
}
